<% content_for :page_head do %>
  <h1>所有版本标签</h1>
<% end %>

<% content_for :right_side do %>
  <% if current_user.has_role?("admin") || current_user.has_role?("pdm") %>
  <div id="the_other_control">
    <%= link_to image_tag("add_icon.gif"), new_tag_path, :class=>"image"%>
    <%= link_to "创建版本标签", new_tag_path, :class=>"grey" %>
  </div>
  <% end %>

<% end %>

<table cellspacing="0" cellpadding="0">
  <thead>
  <tr>
    <th>版本标签</th>
    <th>Issue数量</th>
    <th>所属项目</th>
    <th>应完成于</th>
  </tr>
  </thead>
  <tbody>
<% for tag in @need_to_release_tags %>
  <tr>
    <td><%= link_to tag.name, tag %></td>
    <td><%= tag.count_tagged.to_s %></td>
    <td><%= tag.project.name %></td>
    <td><%= tag.should_release_at.nil? ? "--" : tag.should_release_at.strftime("%Y-%m-%d %H:%M")%></td>
  </tr>
<% end %>
  </tbody>
</table>
<%= will_paginate @need_to_release_tags, :previous_label => "", :next_label => "下一页 &raquo;" %>

<h2>已完成的版本标签</h2>
<table cellspacing="0" cellpadding="0">
  <thead>
  <tr>
    <th>版本标签</th>
    <th>所属项目</th>
    <th>应完成于</th>
    <th>实际发布时间</th>
  </tr>
  </thead>
  <tbody>
<% for tag in @released_tags %>
  <tr>
    <td><%= link_to tag.name, tag %></td>
    <td><%= tag.project.name %></td>
    <td><%= tag.should_release_at.nil? ? "--" : tag.should_release_at.strftime("%Y-%m-%d %H:%M")%></td>
    <td><%= tag.release_at.nil? ? "--" : tag.release_at.strftime("%Y-%m-%d %H:%M") %></td>
  </tr>
<% end %>
  </tbody>
</table>
<%= will_paginate @released_tags, :previous_label => "", :next_label => "下一页 &raquo;" %>